import React,{useState,useEffect,useRef} from 'react'
import { Tabs } from 'antd';
import ActivityInfoBasic from './components/activityInfoBasic'
import ActivityInfoActivity from './components/activityInfoActivity'
import './style/activityDataInfo.less'
export default function activityDataInfo(props:any) {
const [activityInfo,setActivityInfo] = useState({})


const { TabPane } = Tabs;

useEffect(()=>{
  if(props.location.state && props.location.state.data){
    setActivityInfo(props.location.state.data)
  }
},[props])

function callback(key:any) {
  console.log(key);
}
  return (
    <div className="activity_Data_info">
      <div className="activity_Data_info_box">
      
        {JSON.stringify(activityInfo) !== '{}'?<Tabs defaultActiveKey="2" onChange={callback}>
          <TabPane tab="基本信息" key="1">
            <ActivityInfoBasic formData={activityInfo}></ActivityInfoBasic>
          </TabPane>
          <TabPane tab="活动信息" key="2">
            <ActivityInfoActivity formData={activityInfo}/>
          </TabPane>
        </Tabs>:null}
      </div>
    </div>
  )
}
